.TH "IXP_LISTEN" 3 "2012 Dec" "libixp Manual"


.SH NAME

.P
ixp_listen, IxpConn

.SH SYNOPSIS

.nf
#include <ixp.h>

IxpConn *ixp_listen(IxpServer *srv, int fd, void *aux, void (*read)(IxpConn *), void (*close)(IxpConn *));

typedef struct IxpConn IxpConn;
struct IxpConn {
        IxpServer*      srv;
        void*           aux;    /* Arbitrary pointer, to be used by handlers. */
        int             fd;     /* The file descriptor of the connection. */
        void            (*read)(IxpConn *);
        void            (*close)(IxpConn *);
        char            closed; /* Non-zero when \fIfd\fR has been closed. */

        /* Private members */
        ...
}
.fi


.SH PARAMETERS

.TP
fs
The file descriptor on which to listen.
.TP
aux
A piece of data to store in the connection's
\fIaux\fR member of the IxpConn data structure.
.TP
read
The function called when the connection has
data available to read.
.TP
close
A cleanup function called when the
connection is closed.

.SH DESCRIPTION

.P
Starts the server \fIsrv\fR listening on \fIfd\fR. The optional
\fIread\fR and \fIclose\fR callbacks are called with the IxpConn
structure for the connection as their sole argument.

.SH RETURN VALUE

.P
Returns the connection's new IxpConn data structure.

.SH SEE ALSO

.P
ixp_serverloop(3), ixp_serve9conn(3), ixp_hangup(3)

.\" man code generated by txt2tags 2.6 (http://txt2tags.org)
.\" cmdline: txt2tags -o- ixp_listen.man3
